<template>
  <!-- // ECU管理 -->
  <div class="tablePageWarp">
    <div class="commonSelectWidth">
      <a-form layout="vertical" >
        <a-row :gutter="[16,0]">
          <a-col :md="4" :sm="24">
            <a-form-model-item :label="$t('partNumber')">
              <a-input
                v-model.trim="queryParam.ecuModuleId"
                :placeholder="$t('pleaseInput') + $t('partNumber')"
                @keyup.enter="refreshData(true)"
                allowClear
              />
            </a-form-model-item>
          </a-col>
          <a-col :md="4" :sm="24">
            <a-form-model-item :label="$t('partName')">
              <a-input
                v-model.trim="queryParam.name"
                :placeholder="$t('pleaseInput') + $t('partName')"
                @keyup.enter="refreshData(true)"
                allowClear
              />
            </a-form-model-item>
          </a-col>
          <!-- 车型 -->
          <!-- <a-col :md="4" :sm="24">
            <car-model-select
              :query="{ }"
              :default-value="queryParam.modelId"
              :hasAll="false"
              :clear="true"
              mode="multiple"
              :maxTagCount="1"
              @changeoption="(val) => {queryParam.modelId = val;refreshData(true);}"
              style="width: 100%"
            ></car-model-select>
          </a-col> -->
          <!--        数据来源-->
          <a-col :md="4" :sm="24">
            <a-form-model-item :label="$t('数据来源')">
              <a-select
                v-model="queryParam.dataFrom"
                @change="refreshData(true)"
                optionFilterProp="children"
                :filterOption="$commonFun.filterOption"
                showSearch
                placeholder="数据来源"
                allow-clear
                style="width:100%"
              >
                <a-select-option
                  v-for="(item, index) in configModelDataFrom"
                  :key="'dataFrom'+index"
                  :value="item.value"
                  :title="item.name"
                >{{ item.name }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <!-- 确认状态-->
          <a-col :md="4" :sm="24">
            <a-form-model-item :label="$t('确认状态')">
              <a-select
                v-model="queryParam.syncCheck"
                optionFilterProp="children"
                :filterOption="$commonFun.filterOption"
                @change="refreshData(true)"
                showSearch
                placeholder="确认状态"
                allow-clear
                style="width:100%"
              >
                <a-select-option
                  key="syncCheck1"
                  :value="0"
                >未确认</a-select-option>
                <a-select-option
                  key="syncCheck2"
                  :value="1"
                >已确认</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <!--软件编码-->
          <a-col :md="4" :sm="24">
            <a-form-model-item :label="$t('softwareCoding')">
              <a-select
                v-model="queryParam.softwareCode"
                @change="refreshData(true)"
                showSearch
                allow-clear
                optionFilterProp="children"
                :filterOption="false"
                @search="loadSoftWareCodes"
                :placeholder="$t('pleaseSelect') + $t('softwareCoding')"
                style="width: 100%"
              >
                <a-select-option
                  v-for="(item, index) in filterEcuList"
                  :key="index"
                  :value="item"
                  :title="item"
                >{{ item }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <!-- 供应商 -->
          <a-col :md="4" :sm="24">
            <a-form-model-item :label="$t('供应商')">
              <supplier-select
                mode="multiple"
                :default-value="queryParam.supplierId"
                @changeoption="(val) => {queryParam.supplierId = val;refreshData(true)}"
                style="width: 100%"
              ></supplier-select>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="[16,0]">
          <!-- 创建人-->
          <a-col :md="4" :sm="24">
            <a-form-model-item :label="$t('创建人')">
              <a-select
                v-model="queryParam.createBy"
                @change="refreshData(true)"
                showSearch
                allow-clear
                optionFilterProp="children"
                :filterOption="$commonFun.filterOption"
                :placeholder="$t('pleaseSelect')+ '创建人'"
                :maxTagCount="1"
                style="width:100%"
              >
                <a-select-option
                  v-for="(item,index) in userList"
                  :key="'user'+index"
                  :value="item.id"
                  :title="item.name"
                >{{ item.name + '('+item.account+')' }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <!-- 创建时间-->
          <a-col :md="6" :sm="24">
            <a-form-model-item :label="$t('创建时间')">
              <a-range-picker
                @change="selectDateRange"
                v-model="createTime"
                :show-time="{
                  hideDisabledOptions: true,
                  defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],
                }"
                style="width: 100%"
                :placeholder="['创建时间-开始','创建时间-结束']"
              />
            </a-form-model-item>
          </a-col>
          <a-col :md="14" :sm="24" style="margin-top: 22px;">
            <div class="searchBtns">
              <a-button-group>
                <auth-button type="primary" :auth="managePerms.parts.view" @click="refreshData(true)">
                  <i class="iconfont icon-chazhao"></i>
                  {{ $t('inquiry') }}
                </auth-button>
                <a-button @click="initiSelectValue">
                  <i class="iconfont icon-qingkong"></i>
                  {{ $t('clear') }}
                </a-button>
              </a-button-group>
              <auth-button :auth="managePerms.parts.add" @click="handleAddEdit()">
                <i class="iconfont icon-xinjian"></i>
                {{ $t('new') }}
              </auth-button>
              <auth-button
                :auth="managePerms.parts.delete"
                @click="deleteList(selectedRows, ()=>{selectedRows=[]})"
                type="danger"
              >
                <i class="iconfont icon-shanchu"></i>
                {{ $t('batchDelete') }}
              </auth-button>
              <auth-button
                :auth="managePerms.parts.import"
                @click="importVisible=true"
              >{{ $t('import') }}</auth-button>
              <auth-button
                :auth="managePerms.parts.export"
                @click="exportXlsx"
                :loading="exporting"
              >{{ $t('export') }}</auth-button>
              <auth-button
                :auth="managePerms.parts.sync"
                @click="sync"
                :loading="synchronizing"
              >{{ $t('数据更新') }}</auth-button>
            </div>
          </a-col>
        </a-row>
      <!-- <a-row :gutter="[16,16]">
      </a-row> -->
      </a-form>
    </div>
    <s-table
      ref="table"
      class="h100"
      size="default"
      rowKey="id"
      :columns="columns"
      :row-selection="{ selections:true,selectedRowKeys:selectedRowKeys, onChange: onTableSelectChange }"
      :data="loadData"
      :getPopupContainer="$commonFun.getPopupContainer"
      :scrollX="1900"
    >
      <template slot="partNumber" slot-scope="text, record">
        <a @click="showEcuDetail(record)">
          <table-ellipsis :text="text"></table-ellipsis>
        </a>
      </template>
      <template slot="name" slot-scope="text">
        <table-ellipsis :text="text"></table-ellipsis>
      </template>
      <template slot="softwareDid" slot-scope="text">
        <table-ellipsis :text="text"></table-ellipsis>
      </template>
      <template slot="nodeAddress" slot-scope="text">
        <table-ellipsis :text="text"></table-ellipsis>
      </template>
      <template slot="softwareCode" slot-scope="text">
        <table-ellipsis :text="text"></table-ellipsis>
      </template>
      <template slot="ecuHardDid" slot-scope="text">
        <table-ellipsis :text="text || '-'"></table-ellipsis>
      </template>
      <template slot="configurationFile" slot-scope="text">
        <table-ellipsis :text="text || '-'"></table-ellipsis>
      </template>
      <template slot="configSoftwareCode" slot-scope="text">
        <table-ellipsis :text="text || '-'"></table-ellipsis>
      </template>
      <template
        slot="hasConfig"
        slot-scope="text"
      >{{text === true ? $t('yes') : text === false ? $t('no') : '-'}}</template>
      <template
        slot="hasFileSystem"
        slot-scope="text"
      >{{text === true ? $t('yes') : text === false ? $t('no') : '-'}}</template>
      <template slot="relatedModel" slot-scope="text, record">
        <a @click="showEcuDetail(record, 'relatedModel')" v-if="record.modelCount">
          <i class="iconfont icon-chexing"></i>
          <span style="font-weight: bolder">{{ record.modelCount }}</span>
        </a>
        <div v-else>
          <i class="iconfont icon-chexing"></i>
          <span>0</span>
        </div>
      </template>
      <template slot="versionList" slot-scope="text, record">
        <a @click="showEcuDetail(record, 'relatedVersion')" v-if="record.versionCount">
          <i class="iconfont icon-banben"></i>
          <span style="font-weight: bolder">{{ record.versionCount }}</span>
        </a>
        <div v-else>
          <i class="iconfont icon-banben"></i>
          <span>0</span>
        </div>
      </template>
      <template slot="createBy" slot-scope="text">
        <table-ellipsis :text="text"></table-ellipsis>
      </template>
      <template slot="createTime" slot-scope="text">
        <table-ellipsis :text="$commonFun.getDateTimeStr(text)"></table-ellipsis>
      </template>
      <span slot="action" slot-scope="text, record" class="tableOperateSty">
        <template>
          <span style="display: flex;">
            <auth-button type="primary" :ghost="true" size="small" :auth="managePerms.parts.add" @click="copy(record)"><i class="iconfont icon-fuzhi"/>{{ $t('copy') }}</auth-button>
            <auth-button
              type="primary"
              :ghost="true"
              size="small"
              :auth="managePerms.parts.edit"
              @click="handleAddEdit(record)"
            ><i class="iconfont icon-xiugai"/>{{ $t('edit') }}</auth-button>
            <auth-button
              type="danger"
              :ghost="true"
              size="small"
              :auth="managePerms.parts.delete"
              @click="deleteList(record)"
              style="word-break: keep-all;"
            ><i class="iconfont icon-shanchu3 deleteUlr"/>{{ $t('delete') }}</auth-button>
          </span>
        </template>
      </span>
    </s-table>
    <a-modal
      v-model="importVisible"
      title="导入ECU"
      width="1000px"
      dialogClass="createFormStyle"
      :bodyStyle="{ height: '500px', overflowY: 'auto' }"
    >
      <template slot="footer">
        <a-button @click="importVisible = false" type="primary">{{ $t('back') }}</a-button>
      </template>
      <div>
        <a-input
          class="formFileInput"
          :placeholder="$t('formatFiles')"
          readonly
          :value="importFile"
          style="width:400px;margin-right: 10px"
        >
          <template #addonAfter>
            <i class="iconfont icon-shangchuan" @click="$refs.upload.uploadDo()"></i>
          </template>
        </a-input>
        <a-button @click="downloadTemplate" :loading="downloading">{{ $t('downloadTemplate') }}</a-button>
        <a-spin :spinning="importing" tip="导入中...">
          <div style="min-height: 300px">
            <template v-if="uploadRes.fail.length > 0">
              <h4 style="margin-top:20px;color:red">失败明细(共{{uploadRes.failCount}}条)：</h4>
              <a-table
                ref="importFailTable"
                class="h100 withMinHeightTbodyBox"
                :rowKey="(record, index) => 'fail-' + index"
                :columns="importFailColumns"
                :data-source="uploadRes.fail"
                :scroll="{x:1500,y:300}"
                :pagination="false"
              >
                <span
                  slot="message"
                  slot-scope="message"
                  style="color:red;white-space: pre-line"
                >{{ message }}</span>
              </a-table>
            </template>
            <template v-if="uploadRes.success.length > 0">
            <h4 style="margin-top:20px;">导入成功(共{{uploadRes.successCount}}条)：</h4>
            <a-table
              v-if="uploadRes.success.length > 0"
              ref="importSuccessTable"
              class="h100 withMinHeightTbodyBox"
              :rowKey="(record, index) => 'suc-' + index"
              :columns="importSuccessColumns"
              :data-source="uploadRes.success"
              :scroll="{x:1500,y:300}"
              :pagination="false"
            ></a-table>
          </template>
          </div>
        </a-spin>
        <!-- 来自文件上传 -->
        <local-upload
          ref="upload"
          :domView="false"
          @showFileObj="showFileObj"
          :accept="['.xls','.xlsx']"
        ></local-upload>
      </div>
    </a-modal>
  </div>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import HasNoPermissionTip from '@/components/HasNoPermissionTip'
import TableEllipsis from '@/components/Ellipsis/TableEllipsis'
import { minxinDrawerUse } from '@/utils/mixin'
import NewEditEcu from './components/NewEditEcu.vue'
import EcuDetail from './components/EcuDetail'
import { STable } from '@/components'
import AuthButton from '@/components/AuthButton'
import AuthText from '@/components/AuthText'
import { managePerms } from '@/config/permission/index'
import EditSupplierList from './components/EditSupplierList'
import CarModelSelect from '@/views/components/CarModelSelect'
import SupplierSelect from '@/views/components/SupplierSelect.vue'
import moment from 'moment'
import { ecuColumns } from './config/list'
import userApi from '../../../api/modules/system/user'
import { downloadBlobFile } from '@/utils/functions'
import LocalUpload from '@/components/Upload/LocalUpload'
import i18n from '../../../lang'
const initQueryParam = {
  ecuModuleId: '',
  modelId: undefined,
  name: '',
  supplierId: undefined
}
export default {
  name: 'EcuList',
  mixins: [minxinDrawerUse],
  components: {
    HasNoPermissionTip,
    TableEllipsis,
    NewEditEcu,
    EcuDetail,
    STable,
    AuthButton,
    AuthText,
    CarModelSelect,
    LocalUpload,
    SupplierSelect
  },
  computed: {
    ...mapState({
      ecuReprogramTypeDictCode: state => state.dict.ecuReprogramTypeDictCode,
      ecuReprogramWayDictCode: state => state.dict.ecuReprogramWayDictCode,
      configModelDataFrom: state => state.dict.configModelDataFromDictCode,
      ecuParma: state => state.ecu,
      rightDrawerEvent: state => state.ecu.rightDrawerEvent
    }),
    hlvFlagObjText() {
      return this.$store.getters.getDictCodeObj('hlvFlagDictCode')
    },
    hvPowerFlagObjText() {
      return this.$store.getters.getDictCodeObj('hvPowerFlagDictCode')
    },
    ecuUpdateStyleObjText() {
      return this.$store.getters.getDictCodeObj('ecuUpdateStyleDictCode')
    }
  },
  data() {
    let data = {
      moment,
      createTime:null,
      columns: ecuColumns,
      importFile: '',
      uploadRes: {
        fail: [],
        success: [],
        failCount: 0,
        successCount: 0
      },
      importVisible: false,
      importing: false,
      exporting: false,
      synchronizing: false,
      downloading: false,
      //创建人下拉框数据
      userList: [],
      //软件编码下拉框数据
      filterEcuList: [],
      managePerms,
      supplierSelectList: [], // 制造商筛选
      modelSelect: [],
      //列表数据
      tableData: [],
      //选中行数据
      selectedRows: [],
      selectedRowKeys: [],
      // 查询参数
      queryParam: { ...initQueryParam }
    }
    let cols = [
      {
        title: '车型代码',
        dataIndex: 'modelCode',
        width: '120px',
        scopedSlots: { customRender: 'modelCode' }
      },
      ...data.columns
    ]
    cols.splice(cols.length - 6, 6)
    cols.push(
      {
        title: '是否验证config.xml',
        dataIndex: 'checkConfig',
        width: 130,
        customRender: (text, record, index) => {
          return text === true ? i18n.t('yes') : text === false ? i18n.t('no') : '-'
        },
        scopedSlots: { customRender: 'checkConfig' }
      },
      {
        title: '失败原因',
        dataIndex: 'message',
        width: '200px',
        fixed: 'right',
        scopedSlots: { customRender: 'message' }
      }
    )
    data.importFailColumns = cols
    data.importSuccessColumns = [...cols]
    data.importSuccessColumns.splice(cols.length - 1, 1)
    return data
  },
  watch: {
    rightDrawerEvent: {
      handler() {
        this.handlerRightDrawerEvent()
      },
      immediate: true
    },
    importVisible(val) {
      if (!val) {
        this.importFile = ''
        this.uploadRes.fail = []
        this.uploadRes.success = []
      }
    }
  },
  created() {
    this.filterItem()
  },
  mounted() {
    this.initiSelectValue()
    this.$store.dispatch('getEcuReprogramTypeDictCodeData')
    this.$store.dispatch('getEcuReprogramWayDictCodeData')
    this.$store.dispatch('getEcuUpdateStyleDictCodeData')
    this.$store.dispatch('getHvPowerFlagDictCodeData')
    this.$store.dispatch('getHlvFlagDictCodeData')
    this.$store.dispatch('getEcuEncryptTypeDictCodeData')
    this.$store.dispatch('getConfigModelDataFromDictCodeData')
    this.loadUsers()
  },
  methods: {
    onTableSelectChange(selectedRowKeys) {
      this.selectedRowKeys = selectedRowKeys;
      this.selectedRows = selectedRowKeys.map(item => {
        return this.tableData.find(row => row.id === item)
      })
    },
    exportXlsx() {
      this.exporting = true
      this.$api
        .exportEcuList(this.queryParam)
        .then(res => {
          downloadBlobFile(res, '导出ECU' + moment().format('YYYYMMDDHHmmss') + '.xlsx')
        })
        .finally(() => {
          this.exporting = false
        })
    },
    sync() {
      this.synchronizing = true
      this.$api
        .syncEcuGcy()
        .then(res => {
          this.$message.success('同步完成');
        })
        .finally(() => {
          this.synchronizing = false
        })
    },
    downloadTemplate() {
      this.downloading = true
      this.$api
        .importEcuTemplate()
        .then(res => {
          downloadBlobFile(res, 'ECU导入模板.xlsx')
        })
        .finally(() => {
          this.downloading = false
        })
    },
    showFileObj(value) {
      const vm = this
      vm.importFile = value.name
      const formData = new FormData()
      formData.append('file', value)
      this.uploadRes.fail = []
      this.uploadRes.success = []
      this.uploadRes.failCount = 0
      this.uploadRes.successCount = 0
      this.importing = true;
      vm.$api
        .importEcuList(formData)
        .then(res => {
          if (res.data) {
            if (res.data.fail) {
              res.data.fail.forEach(item => {
                vm.uploadRes.fail.push({
                  ...item.data,
                  message: item.message
                })
              })
              vm.uploadRes.failCount = vm.uploadRes.fail.length
              // 截取500条
              vm.uploadRes.fail.splice(500)
            }
            if (res.data.success) {
              res.data.success.forEach(item => {
                vm.uploadRes.success.push(item.data)
              })
              vm.uploadRes.successCount = vm.uploadRes.success.length
              vm.uploadRes.success.splice(500)
            }
            if (vm.uploadRes.successCount === 0 && vm.uploadRes.failCount === 0) {
              vm.$message.error('没有数据！')
            }
            if (vm.uploadRes.successCount > 0) {
              this.refreshData(false)
            }
          }
        })
        .catch(() => {
          vm.importFile = ''
        }).finally(() => this.importing=false)
    },
    selectDateRange(date, dateString) {
      this.queryParam.createTimeStart = dateString[0]
      this.queryParam.createTimeEnd = dateString[1]
      this.refreshData(true);
    },
    loadSoftWareCodes(val) {
      this.$api.getEcuList({softwareCode: val,pageSize:100}).then(res => {
        //软件编码去重
        this.filterEcuList = new Set([...res.data].map(ecu => ecu.softwareCode));
      })
    },
    loadUsers() {
      userApi.getUserPageData({pageSize:500}).then(res => {
        this.userList = res.data
      })
    },
    handlerRightDrawerEvent() {
      const method = this[this.rightDrawerEvent.key]
      if (method) {
        method(this.rightDrawerEvent.data)
      }
    },
    // 编辑供应商列表
    showSupplierList(oneEcuData) {
      console.log(oneEcuData, 'oneEcuData')
      const buttons = [
        {
          key: '',
          title: 'back',
          type: 'primary',
          name: 'backBtn',
          method: () => {
            // 返回则更新供应商下拉列表数据并重置rightDrawerEvent的值
            this.handleAddEdit({ ...oneEcuData, back: true })
            this.$store.commit('resetEcuManagementRightDrawerEvent')
          },
          callback: null,
          loading: false,
          disabled: false
        }
      ]
      const headerButtons = [
        {
          type: '',
          method: comp => {
            comp.addRecord()
          },
          iconCls: 'icon-xinjian',
          class: 'headerBtnClas'
        }
      ]
      this.setDrawerConfig({
        compName: EditSupplierList,
        title: this.$t('edit') + this.$t('supplier'),
        footerButtons: buttons,
        headerButtons,
        vars: {
          class: 'rightDrawerWithoutCol'
        },
        width: 'huge'
      })
    },
    // 下拉框 重置和初始化
    initiSelectValue() {
      this.queryParam = { ...initQueryParam }
      this.createTime = undefined;
      this.refreshData(true)
    },
    // 筛选条件
    filterItem() {
      const vm = this
      vm.$api.getMyAllModelCode({}).then(response => {
        vm.modelSelect = response.data
      })
      vm.$api.getSupplierSelect().then(response => {
        vm.supplierSelectList = response.data
      })
      this.loadSoftWareCodes()
    },
    loadData(parameter) {
      const vm = this
      // 如果是全部则不传值给后端
      const JnqueryParam = JSON.parse(JSON.stringify(vm.queryParam))
      // eslint-disable-next-line no-restricted-syntax
      for (const key in JnqueryParam) {
        if (JnqueryParam[key] === '') {
          JnqueryParam[key] = undefined
        }
      }
      this.tableData = []
      this.selectedRows = []
      this.selectedRowKeys = []
      const apiPromise = vm.$api.getEcuList({ ...parameter, ...JnqueryParam })
      return new Promise((resolve, reject) => {
        return apiPromise.then(res => {
          if (res.data) {
            this.tableData = res.data
          }
          resolve(res)
        }).catch(err => {
          reject(err)
        })
      })
    },
    copy(recordData = {}) {
      // let {id, ...data} = recordData;
      // this.handleAddEdit(this.$commonFun.deepCopy(data));
      this.handleAddEdit({
        id: recordData.id,
        copy: true
      })
    },
    handleAddEdit(recordData = {}) {
      const vm = this
      const buttons = this.getRightDrawerFooterButtons()
      const vars = { recordData }
      if (recordData.id) {
        vm.showRightDrawer(NewEditEcu, vm.$t(recordData.id && !recordData.copy ? 'editECU' : 'newECU'), buttons, 'huge', vars);
      } else {
        vm.showRightDrawerNoReset(NewEditEcu, vm.$t(recordData.id && !recordData.copy ? 'editECU' : 'newECU'), buttons, 'huge', vars);
        vm.setDrawerConfig({
        headerButtons:[]
      })
      }
    },
    // 新增编辑提交
    saveData(values) {
      const vm = this
      let saveEcu = {}
      if (values.id) {
        saveEcu = vm.$api.editEcu(values)
      } else {
        saveEcu = vm.$api.addEcu(values)
      }
      return new Promise((resolve, reject) => {
        saveEcu
          .then(res => {
            vm.filterItem()
            vm.refreshData(!values.id)
            resolve(res)
          })
          .catch(err => {
            reject(err)
          })
      })
    },
    // 批量删除
    deleteList(records, sucCallback) {
      if (!(records instanceof Array)) {
        records = [records]
      }
      if (records.length === 0) {
        this.$message.error('请选择要删除的数据！')
        return
      }
      let items = records.map(item => {
        return item.ecuModuleId
      })
      const vm = this
      this.$confirm({
        title: vm.$t('deleteECU'),
        content: vm.$t('deleteECUTip') + '(' + items.join(', ') + ')',
        class: 'confirmStyle',
        icon: '<Icon >',
        onOk() {
          if (!(records instanceof Array)) {
            records = [records]
          }
          let items = records.map(item => {
            return item.id
          })
          vm.$api.batchDeleteCarEcu({ ids: items }).then(() => {
            vm.$message.success(vm.$t('successfullyDelete'))
            if (sucCallback && typeof sucCallback === 'function') {
              sucCallback()
            }
            vm.filterItem()
            vm.refreshData() // 刷新页面
          })
        },
        onCancel() {}
      })
    },
    // 查看零件详情 numType（关联车型or关联版本）
    showEcuDetail(record, numType) {
      const vars = {
        id: record.id,
        ecuModuleId: record.ecuModuleId,
        numType
      }
      this.showRightDrawer(EcuDetail, `${record.ecuModuleId}[${record.name}]${record.softwareCode}`, [], 'large', vars)
    },
    refreshData(isToFirstPage = false) {
      const vm = this
      vm.$nextTick(() => {
        this.$refs.table.refresh(isToFirstPage)
      })
    }
  }
}
</script>
<style lang="less" scoped>
 ::v-deep .ant-form-item-label {
  padding-bottom: 2px;
}
::v-deep .ant-form-item {
  margin-bottom: 0;
}
</style>
